/*!
//      
//      \file	k2k_StateMachineTypes.c
//      
//      \author	Copyright 2010 Valentina Vuksic <vuksv1@bfh.ch>, Beat Liechti <liecb2@bfh.ch>
//      
//      This program is free software; you can redistribute it and/or modify
//      it under the terms of the GNU General Public License as published by
//      the Free Software Foundation; either version 2 of the License, or
//      (at your option) any later version.
//      
//      This program is distributed in the hope that it will be useful,
//      but WITHOUT ANY WARRANTY; without even the implied warranty of
//      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//      GNU General Public License for more details.
//      
//      You should have received a copy of the GNU General Public License
//      along with this program; if not, write to the Free Software
//      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
//      MA 02110-1301, USA.
//
//		Helper functions for the types for states, events, and state handlers
//      
//      \brief		CAS-EBX-03 Projektarbeit 
//      			Valentina Vuksic (VUKSV1), Beat Liechti (LIECB2)
//      			Helper functions for the State, event, and state handler types 
//					for the k2k (Kaffee2000) application
//      \version	1.0
//      \date		2010-04-11
//      \remark		Last Modifications:
//      \remark  	v1.0, VUKSV1/LIECB2, 2010-04-11 Initial release
//
*/

#include <stdlib.h>

#include "k2k_StateMachineTypes.h"

/*!
//
// Get a text describing the event
//
// \param event is the event to describe
// 
// \return string describing the event
//
*/
char *k2k_StateMachineTypes_GetEventText(k2k_Event event)
{
	switch (event)
	{
		case EVENT_S0: return "EVENT_S0";
		case EVENT_S1: return "EVENT_S1";
		case EVENT_S2: return "EVENT_S2";
		case EVENT_S3: return "EVENT_S3";
		case EVENT_S4: return "EVENT_S4";
		case EVENT_S5: return "EVENT_S5";
		case EVENT_S6: return "EVENT_S6";
		case EVENT_S7: return "EVENT_S7";
		/*case EVENT_INIT: return "EVENT_INIT";*/
		case EVENT_TIMER: return "EVENT_TIMER";
		case EVENT_MAX: return "no event";
		default: return "unknown event";
	}
}

/*!
//
// Get a text describing the state
//
// \param state is the state to describes
// 
// \return string describing the state
//
*/
char *k2k_StateMachineTypes_GetStateText(k2k_State state)
{
	switch (state)
	{
		case STATE_OFF: return "STATE_OFF";
		case STATE_RDY1: return "STATE_RDY1";
		case STATE_RDY2: return "STATE_RDY2";
		case STATE_RSTR: return "STATE_RSTR";
		case STATE_ESPR: return "STATE_ESPR";
		case STATE_MLKC: return "STATE_MLKC";		
		case STATE_CLN: return "STATE_CLN";		
		case STATE_MAX: return "STATE_MAX";
		default: return "unknown state";
	}
}
